home *** CD-ROM | disk | FTP | other *** search
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.5 sun4m)
- MIME-Version: 1.0
- Subject: Re: Randomness
- References: <451.6681T677T994@summat.demon.co.uk> <4l8ob9$22k@sinsen.sn.no>
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- Path: imada.ou.dk!breese
- From: breese@imada.ou.dk (Bjorn Reese)
- Message-ID: <1996Apr21.134747.7212@imada.ou.dk>
- Sender: news@imada.ou.dk
- Nntp-Posting-Host: gounod.imada.ou.dk
- Organization: Dept. of Math. & Computer Science, Odense University, Denmark
- Date: Sun, 21 Apr 1996 13:47:47 GMT
- Newsgroups: comp.sys.amiga.programmer
-
- Odd H. Sandvik wrote:
- >
- > Check this out from P. Hanevold. Mind you, I haven't tried it.
- > From: patrick.hanevold@login.eunet.no (Patrick Hanevold)
- >
- > ; By Patrick Hanevold 5/1-1996
- >
-
- > RND MACRO
- > move.w (a0),\1
- > move.w 2(a0,\1.l*2),\1
- > move.w \1,(a0)
- > ENDM
-
- The problem with this one is that it uses the old random number
- as an index for the next. This can lead to cycles.
-
- Consider this: if the i'th number in the buffer contains the
- value i (if (rndbuf[i]==i)), it'll continue to return the value
- i forever. Making quick adjustments to avoid this problem doesn't
- work as the whole method is faulty.
-
- I've previously made Patrick aware of this, but he didn't seem to
- care because it happend to work for him. That he ignores these
- flaws are ok by me, but when other people start using this method
- I feel that I have to warn about it. I'm not saying that this method
- doesn't work at all, just that there are some ugly traps in it, and
- sooner or later they _will_ occur.
-
- Furthermore, this method suffers from the same problem as most
- simple/fast random number generators, namely that once you encounter
- a number twice it'll return the exactly same sequence of numbers again
- and again.
-
- --
- Bjorn Reese Email: breese@imada.ou.dk
- Odense University, Denmark URL: http://www.imada.ou.dk/~breese
-
- "It's getting late in the game to show any pride or shame" - Marillion
-